<template>
  <div>
    <h3>我是{{name}}，今年{{age}} {{click}}</h3>
  </div>
</template>

<script>
export default {
  name: 'Cpn',
  components: {
    
  },
  props: {
    name: {
      type: String,
      default: '张三'
    },
    age: {
      type: Number,
      default: 18
    },
    click: {
      type: Function,
      default: function() {
        console.log('我是父组件的click方法');
      }
    },
  },
  data() {
    return {
      
    }
  },
  methods: {
    click() {
      alert('我被点击了');
    }
  },  
}
</script>

